package com.yanqu.road.server.channelserver.cmd.activity.tonbing;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.union.cross.CrossUnionProto;
import com.yanqu.road.server.channelserver.cmd.ChannelCommand;
import com.yanqu.road.server.channelserver.manager.activity.ChannelActivityUnionMgr;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.protocol.ChannelProtocol;

@Cmd(code = ChannelProtocol.N_ACTIVITY_GET_UNION_INFO_RESP, desc = "去拉取商会的赚钱排行榜")
public class ChannelGetUnionRespCmd extends ChannelCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionProto.ChannelGetUnionMaxAbilityRankListResp reqMsg = CrossUnionProto.ChannelGetUnionMaxAbilityRankListResp.parseFrom(packet.getBytes());
        if(reqMsg.getActivityId() != 0){
            ChannelActivityUnionMgr.addUnionInfo(reqMsg);
        }else{
            ChannelActivityUnionMgr.updateChannelServer(reqMsg);
        }
    }

    @Override
    public void sendData() {

    }
}
